home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / LIB / DEBUG_IN.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  3.2 KB  |  99 lines

  1. package sub_arctic.lib;
  2.  
  3. import sub_arctic.output.drawable;
  4. import sub_arctic.lib.top_level;
  5.  
  6. import java.applet.Applet;
  7. import java.awt.Graphics;
  8. import java.awt.Event;
  9. import java.awt.Point;
  10. import java.awt.Dimension;
  11. import java.awt.Rectangle;
  12.  
  13. /**
  14.  * This is subclass of interactor applet that inserts a debugging lens
  15.  * above its normal subtree (using a debug_lens_top_level object with
  16.  * a fake_top_level child).  This object can be temporarily substituted
  17.  * for a normal interactor_applet for debugging purposes.  By default,
  18.  * the debug_lens_top_level object will activate/deactivate its lens when
  19.  * a mouse button is pressed while holding down both the control and meta
  20.  * keys (but this can be changed).
  21.  *
  22.  * @author Scott Hudson
  23.  */
  24. public class debug_interactor_applet extends interactor_applet {
  25.  
  26.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  27.  
  28.   /** 
  29.    * Construct a new debug_interactor_applet. 
  30.    */
  31.   public debug_interactor_applet()
  32.     {
  33.       super();
  34.     }
  35.  
  36.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  37.  
  38.   /** The fake top_level object object that is placed below the real root and
  39.    *  passed to the user's build_ui() routine.  This is initialized when
  40.    *  we establish the top level interactor in make_top_level().
  41.    */
  42.   protected fake_top_level _fake_top = null;
  43.  
  44.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  45.  
  46.   /**
  47.    * This function is called to create and install a top_level 
  48.    * interactor in this applet. In this case we install a 
  49.    * debug_lens_top_level with a fake_top_level under it.  This fake_top_level
  50.    * is what eventually gets passed into build_ui() (via init()).
  51.    *
  52.    */
  53.   public void make_top_level() 
  54.     {
  55.       /* build the debugging root and install it */
  56.       debug_lens_top_level dtop = 
  57.       new debug_lens_top_level(0, 0, size().width, size().height);
  58.       set_top_interactor(dtop);
  59.  
  60.       /* build the fake root under that */
  61.       _fake_top = new fake_top_level(dtop);
  62.     }
  63.  
  64.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  65.  
  66.   /** 
  67.    * Override do_init to pass the fake top_level object to the user's 
  68.    * build_ui() routine instead of the real one.
  69.    */
  70.   public void do_init()
  71.     {
  72.       manager.register_awt_component(this);
  73.       
  74.       make_top_level();  // install it in the applet
  75.       pre_build_ui();
  76.       build_ui(_fake_top);  // build the UI with the fake root
  77.       post_build_ui(_fake_top);
  78.     }
  79.  
  80.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  81.  
  82. }
  83. /*=========================== COPYRIGHT NOTICE ===========================
  84.  
  85. This file is part of the subArctic user interface toolkit.
  86.  
  87. Copyright (c) 1996 Scott Hudson and Ian Smith
  88. All rights reserved.
  89.  
  90. The subArctic system is freely available for most uses under the terms
  91. and conditions described in 
  92.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  93. and appearing in full in the lib/interactor.java source file.
  94.  
  95. The current release and additional information about this software can be 
  96. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  97.  
  98. ========================================================================*/
  99.